
<div class="col-md-2 col-xs-height navshadow">
    <ul class="nav nav-sidebar" >
            <div class="image">
                <img src="<?php echo base_url("public/images/sidebar_logo.jpg"); ?>" alt="logo_image" width="150px" height="150px" class="img-circle">
                <h3>Trung tâm</h3>
            </div>



            <?php
            foreach ($typeCenters as $value) {
                ?>
                <li class="<?php if ($idType == $value['id_type_center']) echo 'center-active' ?>"><a href="<?php echo base_url('index.php/website/center/type/' . $value['id_type_center']); ?>" ><?php echo $value['name_type']; ?></a>

                    <?php
                }
                ?>

        </ul>
    </div>
    <div class="col-md-10 col-xs-height">    
        <div class="breadcrumbs" style="margin-top: 3%; margin-bottom: 1%;">
            <ul>
                <li><a href="<?php echo base_url("index.php/website/home"); ?>"><span class="glyphicon glyphicon-home"></span> Trang chủ</a></li>
                <li><a href="<?php echo base_url("index.php/website/center"); ?>"><span class="glyphicon glyphicon-road"></span> Trung tâm</a></li>

                <div class=" navbar-right form-inline">
                    <form action="<?php echo $path; ?>" method="post">
                    <select class="form-control" name="sort">
                        <option value="name" <?php if($sort == 'name') echo 'selected'; ?> >Tên</option>
                        <option value="view" <?php if($sort == 'view') echo 'selected'; ?>>Lượt xem</option>
                        <option value="rating" <?php if($sort == 'rating') echo 'selected'; ?>>Đánh giá</option>
                    </select>
                    <div class="btn-group" data-toggle="buttons">
                        <label class="btn btn-primary <?php if($orderBy != 'desc') echo 'active'; ?>">
                            <input type="radio" name="orderBy" value="asc"><label class="glyphicon glyphicon-arrow-down text-primary"></label>
                        </label>
                        <label class="btn btn-primary <?php if($orderBy == 'desc') echo 'active'; ?>">
                            <input type="radio" name="orderBy" value="desc"><label class="glyphicon glyphicon-arrow-up text-primary"></label>
                        </label>
                    </div>
                    <button type="submit" class="btn btn-default">Sắp xếp</button>
                    </form>
                </div>
            </ul>

        </div>
        
        
        <div class="highlight" style="display: block">
            <?php
            if (!$listCenters) {
                ?>
            <div class="panel panel-body myshadow" style="margin-bottom:0px;">
                    <div class="row">
                        Không tìm thấy trung tâm nào
                    </div>
                </div>
                <?php
            } else {
                foreach ($listCenters as $value) {
                    ?>
                    <div class="panel panel-body myshadow" style="margin-bottom:0px;">
                        <div class="row">
                            <h3 style="margin-top: 0px"><a href="<?php echo base_url('index.php/website/center/loadById/' . $value['id_center']); ?>"><?php echo $value['name']; ?></a></h3>
                            <p class="text-muted" style="font-size: 12px;">
                                <i class="col-md-8"> Địa chỉ : <b class="text-danger"><?php echo $value['num'].' '.$value['street'].', '.$value['ward'].', '.$value['district']; ?></b> </i> 
                                <i class="col-md-2"> Đánh giá : <b class="text-danger"><?php echo $value['rating']; ?></b> </i> 
                                <i class="col-md-2"> Lượt xem : <b class="text-danger"><?php echo $value['view']; ?></b> </i>

                            </p><br>
                            <hr>
                        </div>
                        <div class="row content">
                            <p>
                                <?php
                                if (strlen($value['discription']) > 300) {
                                    $value['discription'] = substr($value['discription'], 0, 300);
                                    $value['discription'] = substr($value['discription'], 0, strrpos($value['discription'], ' '));
                                }
                                echo $value['discription'].' ...';
                                ?>
                                <a href="<?php echo base_url('index.php/website/center/loadById/' . $value['id_center']); ?>">Chi tiết</a>
                                <?php
                                ?>
                            </p>
                        </div>
                    </div>
                    <?php
                }
            }
            ?>
            <div class="navbar-right">
                <?php echo $link; ?>
            </div>
           
            
        </div>
    </div>

